﻿using System.Collections.Generic;

namespace DataAchive.Model.Payloads
{
    public class Data4SaveRequest
    {
        public string messagetype { get; set; }
        /// <summary>
        /// 条码
        /// </summary>
        public string lotid { get; set; }
        /// <summary>
        /// IP
        /// </summary>
        public string client_ip { get; set; }

        public EL_Info el_info { get; set; }

        public VI_Info vi_info { get; set; }

        //是否超时数据 新增1
        public bool Is_Timeout { get; set; }
        //"超时条码判定。1:NG,2:OK,3:AI结果,4:不分类"  新增
        public int TimeoutClassify { get; set; }
        //新增
        public int Productmodel { get; set; }
        //新增
        public string Windowtype { get; set; }
    }



    public class EL_Info
    {
        /// <summary>
        /// 结果
        /// </summary>
        public string result { get; set; }

        public string manually_result { get; set; }
        /// <summary>
        /// true,手动分类；false,Ai分类 
        /// </summary>
        public bool manually_classified { get; set; }
        /// <summary>
        /// 线别号
        /// </summary>
        public string lineid { get; set; }
        /// <summary>
        /// 设备号
        /// </summary>
        public string equipmentid { get; set; }
        /// <summary>
        /// 图像的base64编码
        /// </summary>
        public string pic_data_base64 { get; set; }
        /// <summary>
        /// 缺陷 数组
        /// </summary>
        public List<Location> location { get; set; }
        /// <summary>
        /// 缺陷 统计
        /// </summary>
        public List<ClassifyCount> classify_count { get; set; }

        public int row_number { get; set; }
        /// <summary>
        /// 0代表 数字，1，代表字母
        /// </summary>
        public int row_type { get; set; }
        /// <summary>
        /// //true 代表正序，如1-N，false代表反序如N-1
        /// </summary>
        public bool row_order { get; set; }

        public int column_number { get; set; }
        public int column_type { get; set; }
        public bool column_order { get; set; }
        /// <summary>
        /// 图片的上下间距
        /// </summary>
        public int TopBottomMargin { get; set; }
        /// <summary>
        /// 图片的左右间距
        /// </summary>
        public int LeftRightMargin { get; set; }
        /// <summary>
        /// 换班开始时间
        /// </summary>
        public string ShiftStartTime { get; set; }
        /// <summary>
        /// 班次
        /// </summary>
        public int Shiftings { get; set; }
        /// <summary>
        /// 0.第一班 1.第二班 2.第三班
        /// </summary>
        public int CurrentShift { get; set; }
    }

    public class VI_Info : EL_Info
    {

    }

    /// <summary>
    /// 缺陷 数组
    /// </summary>
    public class Location
    {
        public double? PX { get; set; }  //x坐标
        public double? PY { get; set; }  //y坐标
        public double? Width { get; set; }  //宽度
        public double? Height { get; set; } //高度
        public string Classify { get; set; }
        public double? Value { get; set; }
    }
    public class ClassifyCount
    {
        /// <summary>
        /// 缺陷名称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 缺陷数量
        /// </summary>
        public double amount { get; set; }
    }


}
